package com.jms.web.mapper;

import com.jms.web.pojo.Card;
import com.jms.web.pojo.Person;
import org.apache.ibatis.annotations.One;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface CardMapper {
    @Select("select * from card")
    @Results({
            @Result(column = "id",property = "id"),
            @Result(column = "number",property = "number"),
            @Result(column = "pid",property = "person",javaType = Person.class,
                    one = @One(select = "com.jms.web.mapper.PersonMapper.getPersons")
            )}
    )
    public List<Card> selectAllCard();
}
